package com.vchello.bean.pro;

import java.io.Serializable;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.vchello.bean.user.User;

/**
 * 
 * @author power
 * 投资笔记
 */
@TableName("invest_note")
public class InvestNote extends Model<InvestNote> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	public static SimpleDateFormat stringTodate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	public static SimpleDateFormat dateTostring = new SimpleDateFormat("yyyy年MM月dd HH:mm:ss");

	@TableId("id")
	private int id;

	@TableField("pro_id")
	private int proId;

	@TableField("user_id")
	private int userId;

	@TableField("create_time")
	private String createTime;

	@TableField("update_time")
	private String updateTime;

	@TableField("content")
	private String content;

	@TableField(exist = false)
	private String createTimeView;

	@TableField(exist = false)
	private String updateTimeView;

	@TableField(exist = false)
	private User user;
	
	public InvestNote() {
		super();
	}

	public InvestNote(int proId, int userId, String createTime, String updateTime, String content) {
		super();
		this.proId = proId;
		this.userId = userId;
		this.createTime = createTime;
		this.updateTime = updateTime;
		this.content = content;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getProId() {
		return proId;
	}

	public void setProId(int proId) {
		this.proId = proId;
	}

	public int getUserId() {
		return userId;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

	public String getCreateTime() {
		return createTime;
	}

	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}

	public String getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(String updateTime) {
		this.updateTime = updateTime;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public String getCreateTimeView() {
		Date date;
		try {
			date = stringTodate.parse(createTime);
			return dateTostring.format(date);
		} catch (ParseException e) {
			e.printStackTrace();
		}
		return "";
	}

	public void setCreateTimeView(String createTimeView) {
		this.createTimeView = createTimeView;
	}

	public String getUpdateTimeView() {
		Date date;
		try {
			date = stringTodate.parse(updateTime);
			return dateTostring.format(date);
		} catch (ParseException e) {
			e.printStackTrace();
		}
		return "";
	}

	public void setUpdateTimeView(String updateTimeView) {
		this.updateTimeView = updateTimeView;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	@Override
	protected Serializable pkVal() {
		return this.id;
	}
}